package com.dyzx.hbb.modules.attendance.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;

/**
 * 请假类型分类表
 * @TableName attendance_leave_category
 */
@TableName(value ="attendance_leave_category")
@Data
public class AttendanceLeaveCategory {
    /**
     * 主键ID
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 请假类型名称
     */
    private String name;

    /**
     * 请假类型描述
     */
    private String description;

    /**
     * 是否需要审批：默认(1),1-不需要，2-需要
     */
    private Integer needApproval;

    /**
     * 最大请假天数（-1表示无限制）
     */
    private Integer maxDays;

    /**
     * 是否扣工资：默认(1),1-不扣，2-扣
     */
    private Integer deductSalary;

    /**
     * 扣工资比例（0-1之间的小数）
     */
    private Double salarySeductionRate;

    /**
     * 是否计入年假：默认(1),2-计入，1-不计入
     */
    private Integer countAnnualLeave;

    /**
     * 请假类型：默认(1),1-休息，2-请假，3-病假
     */
    private Integer type;

    /**
     * 状态：默认(1),1-启用，2-禁用
     */
    private Integer status;

    /**
     * 创建日期（毫秒级时间戳）
     */
    @TableField(fill = FieldFill.INSERT)
    private Long createDate;

    /**
     * 更新日期（毫秒级时间戳）
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Long updateDate;

    /**
     * 删除标记: 0-未删除, 1-已删除
     */
    private Integer deleted;

    /**
     * 操作人ID
     */
    private Long operatorId;

    /**
     * 企业ID
     */
    private Long organId;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        AttendanceLeaveCategory other = (AttendanceLeaveCategory) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
            && (this.getDescription() == null ? other.getDescription() == null : this.getDescription().equals(other.getDescription()))
            && (this.getNeedApproval() == null ? other.getNeedApproval() == null : this.getNeedApproval().equals(other.getNeedApproval()))
            && (this.getMaxDays() == null ? other.getMaxDays() == null : this.getMaxDays().equals(other.getMaxDays()))
            && (this.getDeductSalary() == null ? other.getDeductSalary() == null : this.getDeductSalary().equals(other.getDeductSalary()))
            && (this.getSalarySeductionRate() == null ? other.getSalarySeductionRate() == null : this.getSalarySeductionRate().equals(other.getSalarySeductionRate()))
            && (this.getCountAnnualLeave() == null ? other.getCountAnnualLeave() == null : this.getCountAnnualLeave().equals(other.getCountAnnualLeave()))
            && (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getCreateDate() == null ? other.getCreateDate() == null : this.getCreateDate().equals(other.getCreateDate()))
            && (this.getUpdateDate() == null ? other.getUpdateDate() == null : this.getUpdateDate().equals(other.getUpdateDate()))
            && (this.getDeleted() == null ? other.getDeleted() == null : this.getDeleted().equals(other.getDeleted()))
            && (this.getOperatorId() == null ? other.getOperatorId() == null : this.getOperatorId().equals(other.getOperatorId()))
            && (this.getOrganId() == null ? other.getOrganId() == null : this.getOrganId().equals(other.getOrganId()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
        result = prime * result + ((getDescription() == null) ? 0 : getDescription().hashCode());
        result = prime * result + ((getNeedApproval() == null) ? 0 : getNeedApproval().hashCode());
        result = prime * result + ((getMaxDays() == null) ? 0 : getMaxDays().hashCode());
        result = prime * result + ((getDeductSalary() == null) ? 0 : getDeductSalary().hashCode());
        result = prime * result + ((getSalarySeductionRate() == null) ? 0 : getSalarySeductionRate().hashCode());
        result = prime * result + ((getCountAnnualLeave() == null) ? 0 : getCountAnnualLeave().hashCode());
        result = prime * result + ((getType() == null) ? 0 : getType().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getCreateDate() == null) ? 0 : getCreateDate().hashCode());
        result = prime * result + ((getUpdateDate() == null) ? 0 : getUpdateDate().hashCode());
        result = prime * result + ((getDeleted() == null) ? 0 : getDeleted().hashCode());
        result = prime * result + ((getOperatorId() == null) ? 0 : getOperatorId().hashCode());
        result = prime * result + ((getOrganId() == null) ? 0 : getOrganId().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", name=").append(name);
        sb.append(", description=").append(description);
        sb.append(", needApproval=").append(needApproval);
        sb.append(", maxDays=").append(maxDays);
        sb.append(", deductSalary=").append(deductSalary);
        sb.append(", salarySeductionRate=").append(salarySeductionRate);
        sb.append(", countAnnualLeave=").append(countAnnualLeave);
        sb.append(", type=").append(type);
        sb.append(", status=").append(status);
        sb.append(", createDate=").append(createDate);
        sb.append(", updateDate=").append(updateDate);
        sb.append(", deleted=").append(deleted);
        sb.append(", operatorId=").append(operatorId);
        sb.append(", organId=").append(organId);
        sb.append("]");
        return sb.toString();
    }
}